<!DOCTYPE HTML>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>节点属性</title>
</head>

<body>
<ul>
<li>javascript</li>
<li>HTML/CSS</li>
<li>jQuery</li>
</ul>
<script type="text/javascript">
debugger
var node = document.getElementsByTagName("li");
for (var i = 0; i < node.length; i++) {
    document.write("li[" + (i + 1) + "]:" + "<br/>" + "节点名:" + node[i].nodeName + "<br/>");
    document.write("节点值:" + node[i].nodeValue + "<br/>");
    document.write("节点类型:" + node[i].nodeType + "<br/><br/>");
}
/*
var lists = document.getElementsByTagName("li");    for(var i=0;i<lists.length;i++)    {        document.write("第"+i+"个节点的名称是"+lists[i].nodeName+"<br  />");        document.write("第"+i+"个节点的值是"+lists[i].nodeValue+"<br  />");        document.write("第"+i+"个节点的类型是"+lists[i].nodeType+"<br  />");        document.write("<br  />");    }*/
/*
var myli = document.getElementsByTagName("li");    for(var i=0;i<myli.length;i++){        var myname=myli[i].nodeName;        var myvalue=myli[i].nodeValue;        var mytype=myli[i].nodeType;document.write(myname+"<br />");document.write(myvalue+"<br />");
document.write(mytype+"<br />");
    }*/
</script>
</body>

</html>